fix(mcp): isolate semantic-only JSON search - #1319
Conversation
The JSON search_graph path always ran the structural search, even when semantic_query was the only filter. Reuse the shared structural-filter check so semantic-only JSON calls retain semantic hits without returning unrelated graph nodes.\n\nAdd regression coverage for both default and JSON output. Signed-off-by: JJordan0K <69581081+JJordan0C@users.noreply.github.com>
|
Thank you for the contribution and for covering the semantic-only JSON path with end-to-end regression tests. This is now triaged as a high-priority MCP output correctness bug for |
|
Reviewed in full. The fix is sound, the three red checks are not your fault, and you were right that #1295 was not fully fixed. Sorry this sat — and sorry that our issue close implied the work was already done. The catch is a good one. Good instinct running The JSON half of your regression test is properly binding: on current On the three failing checks — they are ours, not yours. Your run tested a merge against
That guard has been green on several fully-green runs against current main since. And a diff confined to What we need from you: rebase onto current Once that run is green this is a merge candidate. One cosmetic note, no action needed: your DCO sign-off name reads Thank you for pushing on this after the issue was closed. You were right to. |
|
Correction to my earlier comment: I cited the wrong commit SHA. I said the default-path semantic-only isolation landed in The isolation that is on Nothing about the substance of my review changes. The default (tree) path is isolated on main; the Apologies for the noise — a wrong SHA in a review is the kind of thing that wastes someone's time when they go looking for it. |
…ntic-only-results Signed-off-by: JJordan0K <69581081+JJordan0C@users.noreply.github.com>
…ntic-only-results Signed-off-by: JJordan0K <69581081+JJordan0C@users.noreply.github.com>
|
Hi @DeusData, the branch has been updated with the latest main, and the refreshed CI is now fully green. Thanks again for the detailed review — this should be ready for another look. |
What does this PR do?
Fixes #1295.
search_graphalready skipped the structural query for semantic-only calls inthe default response format, but
format:"json"still ran an unfilteredstructural search. On a 21,221-node index that made the JSON response report all
21,221 nodes and include unrelated groups alongside the semantic matches.
This change shares the structural-filter detection between both output paths
and skips
cbm_store_searchfor semantic-only JSON calls. Mixedsemantic/structural searches keep their existing behavior.
The regression test covers both output formats. The end-to-end reproduction now
returns
total: 0,count: 0, and no structural groups while retainingsemantic rows.
Validation:
Checklist
git commit -s) — required, CI rejectsunsigned commits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)